<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>商品管理</title>
    <link rel="stylesheet" href="./lib/bootstrap/css/bootstrap.css">
    <link rel="stylesheet" href="./lib/bootstrap-validator/css/bootstrapValidator.css">
    <link rel="stylesheet" href="./lib/nprogress/nprogress.css">
    <link rel="stylesheet" href="./css/common.css">
    <link rel="stylesheet" href="./css/one.css">
    <link rel="stylesheet" href="./css/product.css">
</head>

<body>
    <div class="box">
        <!-- 左边导航栏 -->
        <div class="box-left">
            <div class="left-header">
                <h3>最棒的前端</h3>
            </div>
            <div class="left-main">
                <i></i>
                <h3>超级棒的梁红飞</h3>
            </div>
            <div class="left-list">
                <ul class="one-list">
                    <li><i class="glyphicon glyphicon-user"></i>用户管理</li>
                    <li><i class="glyphicon glyphicon-list"></i>
                        <span class="btn-toggle">分类管理</span>
                        <ul class="show-hide">
                            <li>一级分类</li>
                            <li>二级分类</li>
                        </ul>
                    </li>
                    <li><i class="glyphicon glyphicon-th"></i><a href="./product.html">商品管理</a></li>
                </ul>
            </div>
        </div>
        <!-- 右边内容栏 -->
        <div class="box-right">
            <div class="right-header">
                <p class="p-left glyphicon glyphicon-align-justify"></p>
                <p class="p-right glyphicon glyphicon-log-out"></p>
            </div>
            <div class="right-nav">
                <p class="nav-dateil"><b>管理系统/</b>商品管理</p>
            </div>
            <!-- 用户表单数据渲染 -->
            <div class="right-main">
                <button class="btn btn-default" data-toggle="modal" data-target=".modal-product">添加分类</button>
                <table class="table table-bordered text-center table-hover">
                    <thead>
                        <tr>
                            <th>序号</th>
                            <th>商品名称</th>
                            <th>商品描述</th>
                            <th>商品库存</th>
                            <th>商品尺寸</th>
                            <th>商品状态</th>
                            <th>操作</th>
                        </tr>
                    </thead>
                    <tbody>
                    </tbody>
                </table>
                <!-- 生成分页器 -->
                <div class="pull-right">
                    <ul id="paginator"></ul>
                </div>
            </div>
        </div>
        <!-- 模态框 -->
        <div class="modal fade modal-product modal-add" tabindex="-1" role="dialog">
            <div class="modal-dialog " role="document">
                <div class="modal-content">
                    <div class="modal-header btn-primary text-center">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                        <h4 class="modal-title  ">添加商品</h4>
                    </div>
                    <div class="modal-body">
                        <form class="add-form" id="form1">
                            <!-- 下拉列表 -->
                            <div class="form-group">
                                <!-- 好看下拉列表： 给用户看的 -->
                                <div class="dropdown">
                                    <button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
                                      <span class="cate-span">请选择二级分类</span>
                                      <span class="caret"></span>
                                    </button>
                                    <ul class="dropdown-menu cate-two-list" aria-labelledby="dropdownMenu1">
                                        <li><a href="#">Action</a></li>
                                    </ul>
                                </div>
                                <!-- 隐藏来向后台提交数据 -->
                                <input type="hidden" name="brandId" id="brandId">
                            </div>
                            <!-- 商品名称 -->
                            <div class="form-group">
                                <input type="text" class="form-control" name="proName" placeholder="请求输入商品名称">
                            </div>
                            <!-- 商品描述 -->
                            <div class="form-group">
                                <textarea class="form-control" name="proDesc" placeholder="请求输入商品描述"></textarea>
                            </div>
                            <!-- 商品库存 -->
                            <div class="form-group">
                                <input type="text" class="form-control" name="num" placeholder="请求输入商品库存">
                            </div>
                            <!-- 商品尺码 -->
                            <div class="form-group">
                                <input type="text" class="form-control" name="size" placeholder="请求输入商品尺码">
                            </div>
                            <!-- 商品原价 -->
                            <div class="form-group">
                                <input type="text" class="form-control" name="oldPrice" placeholder="请求输入商品原价--必须是数字">
                            </div>
                            <!-- 商品现价 -->
                            <div class="form-group">
                                <input type="text" class="form-control" name="price" placeholder="请求输入商品现价--必须是数字">
                            </div>

                            <!-- 图片上传 -->
                            <div class="form-group">
                                <label for="file" class="btn btn-default">上传图片</label>
                                <!-- name指定图片上传时的name属性 -->
                                <!-- data-url指定图片上传时的接口地址 -->
                                <!-- multiple指定多文件上传 -->
                                <input type="file" name="pic1" data-url="/product/addProductPic" multiple id="file" class="hide">
                                <br>
                                <!-- 隐藏域： 存储图片的地址  -->
                                <input type="hidden" name="picArr" id="picArr">
                                <!-- 图片容器 -->
                                <div class="img-box"></div>
                            </div>
                        </form>
                    </div>

                </div>
                <div class="modal-footer col-lg-9">
                    <button type="button" class="btn btn-default pull-left" data-dismiss="modal">取消</button>
                    <button type="submit" class="btn btn-primary pull-right btn-add-product" form="form1">添加</button>
                </div>
            </div>
            <!-- /.modal-content -->
        </div>
        <!-- /.modal-dialog -->
    </div>
    <!-- /.modal -->

    <!-- 模板建设 -->
    <script type="text/html" id="tmp">
        {{each rows v i}}
        <tr>
            <td>{{i+1+size*(page-1)}}</td>
            <td>{{v.proName}}</td>
            <td>{{v.proDesc}}</td>
            <td>{{v.num}}</td>
            <td>{{v.size}}</td>
            <td>{{v.statu==1?'已上架':'已下架'}}</td>
            <td data-id="{{v.id}}">
                {{if v.statu==1}}
                <button class="btn btn-danger">下架</button> {{else}}
                <button class="btn btn-success">上架</button> {{/if}}
            </td>
        </tr>
        {{/each}}
    </script>
    <script type="text/html" id="two-list">
        {{each rows v i}}
        <li data-id="{{v.id}}">{{v.categoryName}}</li>
        {{/each}}
    </script>
    <script src="./lib/jquery/jquery.min.js"></script>
    <script src='./lib/bootstrap/js/bootstrap.min.js'></script>
    <script src="./lib/bootstrap-validator/js/bootstrapValidator.min.js"></script>
    <script src='./lib/artTemplate/template-web.js'></script>
    <script src='./lib/bootstrap-paginator/bootstrap-paginator.js'></script>
    <script src="./lib/nprogress/nprogress.js"></script>
    <script src="./lib/jquery-fileupload/jquery.ui.widget.js"></script>
    <script src="./lib/jquery-fileupload/jquery.fileupload.js"></script>
    <script src="./lib/jquery-fileupload/jquery.iframe-transport.js"></script>
    <script src="./js/common.js"></script>
    <script src="./js/product.js"></script>
    <!-- <script src="./js/one.js"></script> -->
</body>

</html>